﻿package rob.data{
	public class Matrix4{
		public var m11, m12, m13, m14;
		public var m21, m22, m23, m24;
		public var m31, m32, m33, m34;
		public var m41, m42, m43, m44;
		
		public function Matrix4(){
			if(arguments.length == 16){
				m11 = arguments[0]; m12 = arguments[1]; m13 = arguments[2]; m14 = arguments[3];
				m21 = arguments[4]; m22 = arguments[5]; m23 = arguments[6]; m24 = arguments[7];
				m31 = arguments[8]; m32 = arguments[9]; m33 = arguments[10]; m34 = arguments[11];
				m41 = arguments[8]; m42 = arguments[9]; m43 = arguments[10]; m44 = arguments[11];
			}
			else{
				// identity
				m11 = m22 = m33 = m44 = 1;
				m12 = m13 = m14 = m21 = m23 = m24 = m31 = m32 = m34 = m41 = m42 = m42 = 0;
			}
		}
		
		public static function createId(){
			return new Matrix4(1,0,0,0,
							   0,1,0,0,
							   0,0,1,0,
							   0,0,0,1);
		}
		
			
		public static function createZero(){
			return new Matrix4(0,0,0,0,
							   0,0,0,0,
							   0,0,0,0,
							   0,0,0,0);
		}
	}
}